package com.dyj.examples.goodlife;

import com.alibaba.fastjson.JSON;
import com.dyj.applet.DyAppletClient;
import com.dyj.applet.domain.query.QueryAdmissibleAuthQuery;
import com.dyj.examples.DyJavaExamplesApplication;
import com.dyj.goodlife.DyGoodLifeClient;
import com.dyj.goodlife.domain.query.CreatePartnerOrderQuery;
import com.dyj.goodlife.domain.query.QueryPartnerOrderQuery;
import com.dyj.goodlife.domain.query.SaveCommissionQuery;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * 基础接口->代运营
 */
@EnableAutoConfiguration
@RunWith(SpringRunner.class)
@SpringBootTest(classes = DyJavaExamplesApplication.class)
public class PartnerTest {


    /**
     * 通用接口->代运营->创建合作关系
     * @return
     */
    @Test
    public void createPartnerOrder() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.createPartnerOrder(CreatePartnerOrderQuery.builder().build())
                )
        );
    }
    /**
     * 通用接口->代运营->合作列表获取
     * @return
     */
    @Test
    public void queryPartnerOrder() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.queryPartnerOrder(QueryPartnerOrderQuery.builder().build())
                )
        );
    }
    /**
     * 通用接口->代运营->合作详情查询
     * @return
     */
    @Test
    public void getPartnerOrder() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.getPartnerOrder(null,null)
                )
        );
    }
    /**
     * 通用接口->代运营->创建/修改佣金
     * @return
     */
    @Test
    public void saveCommission() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.saveCommission(SaveCommissionQuery.builder().build())
                )
        );
    }
    /**
     * 通用接口->代运营->佣金变更记录列表
     * @return
     */
    @Test
    public void queryCommissionRecord() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.queryCommissionRecord(null,null,null)
                )
        );
    }

    /**
     * 通用接口->代运营->佣金变更记录详情
     * @return
     */
    @Test
    public void getCommissionRecord() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.getCommissionRecord(null,null)
                )
        );
    }

    /**
     * 通用接口->代运营->商品佣金详情
     * @return
     */
    @Test
    public void queryProductCommission() {
        DyGoodLifeClient dyGoodLifeClient = new DyGoodLifeClient();
        System.out.println(
                JSON.toJSONString(
                        dyGoodLifeClient.queryProductCommission(null,null,null)
                )
        );
    }

}
